package com.zjitc.service;


import com.zjitc.mapper.UserMapper;
import com.zjitc.pojo.MyUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public MyUser selectUserById(int id) {
        return userMapper.selectUserById(id);
    }

    @Override
    public List<MyUser> selectAllUser() {
        return userMapper.selectAllUser();
    }

    @Override
    public int deleteUser(int id) {
        return userMapper.deleteUser(id);
    }

    @Override
    public int addUser(MyUser user) {
        return userMapper.addUser(user);
    }

    @Override
    public int updateUser(MyUser user) {
        return userMapper.updateUser(user);
    }

    @Override
    public List<MyUser> getUsersByPage(int offset, int pageSize) {
        return userMapper.getUsersByPage(offset, pageSize);
    }

    @Override
    public int getUserCount() {
        return userMapper.getUserCount();
    }
}
